package unilearn.facade;

import java.sql.SQLException;
import java.util.Vector;

import javax.naming.NamingException;

import unilearn.da.DAExtension;
import unilearn.domain.Extension;

/**
 * @author Yin Zhang, 5393558
 * @version 0.1, May 10 2008, initial creation
 */

public class ExtensionFacade
{
	public static Extension getExtensionByStudentAndAssignment(long assignmentID, String studentID) throws SQLException, NamingException
	{
		return DAExtension.getExtensionByStudentAndAssignment(assignmentID, studentID);
	}
	
	public static Vector<Extension> getExtensionByAssignment(long assignmentID) throws SQLException, NamingException
	{
		return DAExtension.getExtensionsByAssignment(assignmentID);
	}
	
	public static Vector<Extension> getExtensionByStudentID(String studentID) throws SQLException, NamingException
	{
		return DAExtension.getExtensionsByStudentID(studentID);
	}
	
	public static Vector<Extension> getExtensionByStaffID(String staffID) throws SQLException, NamingException
	{
		return DAExtension.getExtensionsByStaffID(staffID);
	}
	
	public static void createNewExtension(Extension extension) throws SQLException, NamingException
	{
		DAExtension.insertExtension(extension);
	}
	
	public static void updateOldExtension(long assignmentID, String studentID, Extension extension) throws SQLException, NamingException
	{
		DAExtension.updateExtension(assignmentID, studentID, extension);
	}
}
